#!/bin/bash
source /etc/profile

dt=`date -d "$d  1 days ago "  "+%Y-%m-%d"`
# 删除一些实时表数据，只保留两天的数据
mysql -uroot -proot<<EOF
use result;
delete from res_evaluation_today where evaluation_time<='$dt';
delete from res_oil_today where hours<='$dt';
delete from res_notoil_today where hours<='$dt';
delete from res_evaluation_today where evaluation_time<='$dt';
delete from res_oil_vip_today where hours<='$dt';
delete from res_notoil_vip_today where hours<='$dt';
EOF